package com.zxy;

import java.util.Random;

public class zrh02 {
    public static void main(String[] args) {
        Random r = new Random();
        int[][] arr = new int[3][4];
        for (int i = 0; i < arr.length; i++) {
            for (int j = 0; j < arr[i].length; j++) {
                arr[i][j] = r.nextInt(20, 51);
                System.out.print(arr[i][j] + " ");
            }
            System.out.println();
        }
        System.out.println();
        //求每一组的最大值
        for (int i = 0; i < arr.length; i++) {
            int max = arr[i][0];
            for (int j = 0; j < arr[i].length; j++) {
                if (max < arr[i][j]) {
                    max = arr[i][j];
                }
            }
            System.out.println("max=" + max);
        }
    }
}